package org.webrtc.yl.utils;


import org.webrtc.RTCStats;
import org.webrtc.RTCStatsReport;

import java.util.Map;

public class StatsReportUtil {
    private float  STATS_INTERVAL_MS = 1000L;
    private static String TAG = "StatsReportUtil";
    private int lastBytesReceivedVideo = 0;
    private int lastBytesSentVideo = 0;
    private int lastBytesReceivedAudio = 0;
    private int lastBytesSentAudio = 0;
    private float lastFrameDecodedOut = 0L;
    private float lastFrameDecodedIn = 0L;

    public String getStatsReport(RTCStatsReport report){
        if (report == null) {
            return "";
        }
        boolean audioInFound = false;
        boolean videoInFound = false;
        boolean audioOutFound = false;
        boolean videoOutFound = false;

        String audioInCodec = "unknown";
        String videoInCodec = "unknown";
        String audioOutCodec = "unknown";
        String videoOutCodec = "unknown";

        float audioInBytesDelta = 0L;
        float audioOutBytesDelta = 0L;
        float videoInBytesDelta = 0L;
        float videoOutBytesDelta = 0L;

        float videoInWidth = 0L;
        float videoInHeight = 0L;
        float videoInFrameRate = 0L;

        float videoOutWidth = 0L;
        float videoOutHeight = 0L;
        float videoOutFrameRate = 0L;

        Map<String, RTCStats> statsMap = report.getStatsMap();

        for (RTCStats stats : statsMap.values()) {
            if (stats.getType() == "inbound-rtp") {
                Map<String, Object> members = stats.getMembers();
                //members.get("kind");
            }
        }

        return null;
    }

}
